package com.guoguo.factory;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Produces;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.guoguo.annotations.ControllerLog;
import com.guoguo.annotations.ModelLog;
import com.guoguo.annotations.PersistenceLog;

@Dependent //@Dependent Scope 中的 Bean 的生命周期取决于被注入的 Bean 的生命周期
public class LoggerProvider {
	
	@Produces @PersistenceLog
	public Logger getPersistencelLogger(){
		return LoggerFactory.getLogger("com.guoguo.persistence");
	}
	
	@Produces @ControllerLog
	public Logger getControllerLogger(){
		return LoggerFactory.getLogger("com.guoguo.controller");
	}
	
	@Produces @ModelLog
	public Logger getModelLogger(){
		return LoggerFactory.getLogger("com.guoguo.model");
	}
}
